package com.mzl.lal4cloud.lxw4rf.service.contract.config;

import com.mzl.lal4cloud.lxw4rf.service.contract.bean.AccessToken;
import com.mzl.lal4cloud.lxw4rf.service.contract.bean.HostConfig;
import java.util.concurrent.locks.Lock;

/**
 * @author J_luo
 */
public interface ConfigStorage {

    /**
     * Gets clientId
     * @return the clientId
     */
    String getClientId();

    /**
     * Gets client secret
     * @return the client secret
     */
    String getClientSecret();

    /**
     * Gets private key
     * @return the private key
     */
    String getPrivateKey();
    /**
     * Gets access token.
     *
     * @return the access token
     */
    String getAccessToken();

    /**
     * Gets access token lock.
     *
     * @return the access token lock
     */
    Lock getAccessTokenLock();

    /**
     * Is access token expired boolean.
     *
     * @return the boolean
     */
    boolean isAccessTokenExpired();

    /**
     * 强制将access token过期掉.
     */
    void expireAccessToken();

    /**
     * 应该是线程安全的.
     *
     * @param accessToken 要更新的WxAccessToken对象
     */
    void updateAccessToken(AccessToken accessToken);

    /**
     * 应该是线程安全的.
     *
     * @param accessToken      新的accessToken值
     * @param expiresInSeconds 过期时间，以秒为单位
     */
    void updateAccessToken(String accessToken, int expiresInSeconds);

    /**
     * 是否自动刷新token.
     *
     * @return the boolean
     */
    boolean autoRefreshToken();

    /**
     * 设置信息.
     * @param hostConfig
     */
    void setHostConfig(HostConfig hostConfig);

    /**
     * 获取设置信息
     * @return
     */
    HostConfig getHostConfig();

    /**
     * Gets http proxy host.
     *
     * @return the http proxy host
     */
    String getHttpProxyHost();

    /**
     * Gets http proxy port.
     *
     * @return the http proxy port
     */
    int getHttpProxyPort();

    /**
     * Gets http proxy username.
     *
     * @return the http proxy username
     */
    String getHttpProxyUsername();

    /**
     * Gets http proxy password.
     *
     * @return the http proxy password
     */
    String getHttpProxyPassword();
}
